import { defineStore } from "pinia";

export const menuStore = defineStore({
  id: "menu",
  state: () => ({
    menuList: [
      {
        //路径
        path: "/gameList",
        //组件绑定
        label: "游戏",
        children: [
          {
            //路径
            path: "/gameList/game2048",
            name: "gameList",
            //组件绑定
            component: () => import("../../../views/gameList/game2048/index.vue"),
          },
        ],
      },
      {
        //路径
        path: "/fileList",
        //组件绑定
        label: "文件列表",
        children: [
          {
            //路径
            path: "/gameList/game2048",
            name: "gameList",
            //组件绑定
            component:  () => import("../../../views/gameList/game2048/index.vue"),
          },
        ],
      },
    ],
  }),
  actions: {
    getMenuList(menuList) {
      // 获取菜单列表
      this.menuList = menuList;
    },
  },
});
